home *** CD-ROM | disk | FTP | other *** search
/ Aminet 19 / Aminet 19 (1997)(GTI - Schatztruhe)[!][Jun 1997].iso / Aminet / comm / cnet / time_clock.lha / timerclock / TimeClockT < prev   
Text File  |  1997-03-13  |  3KB  |  62 lines

  1. /**************************************************************************\
  2.      $VER: TimeClock Timer, v2.00 (14-Mar-97) by Dotoran of Frontiers!
  3. \**************************************************************************/
  4. options results;signal on SYNTAX;signal on ERROR;signal on IOERR
  5. a=sourceline(2);parse var a . ", "ver" ("vdate")" .
  6. tr=transmit;se=sendstring;gu=getuser
  7. a="rexxsupport.library";if ~show("l",a) then if ~addlib(a,0,-30) then exit
  8. parse source . . fp .;df=left(fp,max(lastpos('/',fp),lastpos(':',fp)))
  9.  
  10. parse arg port id timer stime tl r ; reminder=strip(r)
  11. mins=tl;if timer=2 then do;a=left(compress(time("n"),":"),4) 
  12.   c=right(right(tl,4,"0")-a,4,"0");mins=(left(c,2)*60)+right(c,2);end
  13.  
  14. a=delay((mins*60)*50) /* Wait the specified number of minutes. */
  15.  
  16. a=getclip(word("CD TD",timer)"timer"id);parse var a p2 id timer st2 tl2 r2
  17. if st2~=stime | tl~=tl2 | r~=r2 then exit 
  18.   else do ; stime=st2 ; tl=tl2 ; r=r2 ; end
  19. if p2~=port then port=p2
  20.  
  21. ADDRESS VALUE "CNETREXX"port
  22.  
  23. lf="0A"x ; gu 40 ; uid=result ; gu 1 ; handle=result
  24.  
  25. if timer=1 then do
  26.   text="r1cb   A T T E N T I O N   r0"lf||lf"ca  "handle"c6, "
  27.   text=text"ce"tl" cfminutes c6have just c9elapsedc6!"
  28.   if reminder>"" then text=text||lf||lf"cf[ca"reminder"cf]"
  29. end
  30.  
  31. else do
  32.   t=left(tl,2)":"right(tl,2);if length(tl)=3 then t=left(tl,1)":"right(tl,2)
  33.   text="r1cb   A T T E N T I O N   r0"lf||lf"ca  "handle"c6, "
  34.   text=text"c6The cftime c6is now ce"t"c6!"
  35.   if reminder>"" then text=text||lf||lf"cf[ca"reminder"cf]"
  36. end
  37.  
  38. if uid=id & getclip(word("CD TD",timer)"timer"id)>"" then call SENDOLM(text)
  39. call setclip(word("CD TD",timer)"timer"id)
  40. exit
  41.  
  42. SENDOLM: /* Sends a SYSTEM OLM Message */
  43.   parse arg text;gu 2307346;path=result;z="00"x;a=""
  44.   if exists(path"_olm"port) then a="a";name=path"_"a"olm"
  45.   a="w";if exists(name) then a="a";h=copies(z,58)strip(text)"0A1A0A"x
  46.   n=name||port;call forbid();call open(f1,n,a);call writeln(f1,h)
  47.   call close(f1);call permit();setobject d2c(0,4);putuser 1409746
  48.   gu 1101743;olm=result+1;setobject olm;putuser 1101743  
  49.  return ""
  50.  
  51. exit
  52. CHECK:;if ARG() & ARG(1)~="###PANIC" then return ARG(1)
  53.   getcarrier;if result="TRUE" then if ARG() then return ARG(1);else return
  54.   logentry "Lost Carrier!!";bufferflush;exit
  55. SYNTAX:;ERROR:;IOERR:;e1="n1 Error: "rc" ("errortext(rc)")"
  56.   e2="  Line: "left(sigl,4)"File:";c="`"fp", "ver"'";e2=e2" "c;tr e1;tr e2
  57.   logentry e1;logentry e2;e=strip(translate(sourceline(sigl),"\{",""))
  58.   do while e~="";e3="Source: "left(e,37);tr e3;logentry e3;e=substr(e,38);end
  59.   bufferflush
  60. /**************************************************************************\
  61. \****************************************** Frontiers BBS (716)/823-9892 **/
  62.